<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 1.用户输入，用户名:zhangsan、密码:123456，则提示登入成功，否则提示失败
    var username = prompt("请输入用户名:");
    var password = prompt("请输入密码:");

    if (username === "zhangsan") {
      if (password === "123456") {
        console.log("登录成功");
      } else {
        console.log("密码错误");
      }
    } else {
      console.log("用户名错误");
    }

  </script>
</body>
</html>